/*
 * @Author: Sam
 * @Date: 2020-10-12 15:23:33
 * @LastEditTime: 2021-10-20 10:22:19
 * @LastEditors: Sam
 * @Description:
 * @FilePath: \resourcesf:\thework\tofba-client\src\router\modules\waybillManagement.js
 * @可以输入预定的版权声明、个性签名、空行等
 */
import Layout from '@/layout/index.vue'
import { randomRange } from '@/utils'
const waybillManagementRouter = {
  path: '/waybillManagement',
  component: Layout,
  redirect: 'noredirect',
  name: 'WaybillManagement',
  meta: {
    title: 'waybillManagement',
    icon: 'order-line'
  },
  children: [
    {
      path: 'waybillList',
      component: () =>
        import(/* webpackChunkName: "bar-chart" */ '@/views/waybillManagement/waybillList.vue'),
      name: 'WaybillList',
      meta: {
        title: 'waybillList',
        noCache: true
      }
    },
    {
      path: 'orderToAirFreight',
      component: () =>
        import(
          /* webpackChunkName: "bar-chart" */ '@/views/waybillManagement/orderToAirFreight.vue'
        ),
      name: 'OrderToAirFreight',
      meta: {
        title: 'orderToAirFreight',
        noCache: true
      },
      beforeEnter: (to, from, next) => {
        const str = randomRange(1, 20)
        if (to.fullPath.indexOf('randomCode') === -1) {
          let icon = '?'
          if (to.fullPath.indexOf('?') > -1) {
            icon = '&'
          }
          next({ path: `${to.fullPath + icon}randomCode=${str}` })
          return
        }

        next()
      }
    },
    {
      path: 'orderToSeaFreight',
      component: () =>
        import(
          /* webpackChunkName: "line-chart" */ '@/views/waybillManagement/orderToSeaFreight.vue'
        ),
      name: 'OrderToSeaFreight',
      meta: {
        title: 'orderToSeaFreight',
        noCache: true
      },
      beforeEnter: (to, from, next) => {
        const str = randomRange(1, 20)
        if (to.fullPath.indexOf('randomCode') === -1) {
          let icon = '?'
          if (to.fullPath.indexOf('?') > -1) {
            icon = '&'
          }
          next({ path: `${to.fullPath + icon}randomCode=${str}` })
          return
        }

        next()
      }
    },
    {
      path: 'orderToExpressDelivery',
      component: () =>
        import(
          /* webpackChunkName: "line-chart" */ '@/views/waybillManagement/orderToExpressDelivery.vue'
        ),
      name: 'OrderToExpressDelivery',
      meta: {
        title: 'orderToExpressDelivery',
        noCache: true
      },
      beforeEnter: (to, from, next) => {
        const str = randomRange(1, 20)
        if (to.fullPath.indexOf('randomCode') === -1) {
          let icon = '?'
          if (to.fullPath.indexOf('?') > -1) {
            icon = '&'
          }
          next({ path: `${to.fullPath + icon}randomCode=${str}` })
          return
        }

        next()
      }
    },
    {
      path: 'pickupInformation',
      component: () =>
        import(
          /* webpackChunkName: "line-chart" */ '@/views/waybillManagement/pickupInformation.vue'
        ),
      name: 'PickupInformation',
      meta: {
        title: 'pickupInformation',
        noCache: true
      }
    },
    {
      path: 'addAirSeag2gwaybill',
      component: () =>
        import(
          /* webpackChunkName: "line-chart" */ '@/views/waybillManagement/addAirSeag2gwaybill.vue'
        ),
      name: 'AddAirSeag2gwaybill',
      meta: {
        title: 'addAirSeag2gwaybill',
        noCache: true
      }
    },
    {
      path: 'waybillDetails/:id',
      hidden: true,
      props: true,
      component: () =>
        import(
          /* webpackChunkName: "line-chart" */ '@/views/waybillManagement/waybillDetails.vue'
        ),
      name: 'WaybillDetails',
      meta: {
        title: 'waybillDetails',
        noCache: true
      }
    }

  ]
}

export default waybillManagementRouter
